package com.wn32.main.demo3;
public class Task {
    private Task(){}//屏蔽构造函数,外界不能访问

    public static class InstanceKeeper{
        private static Task instance=new Task();
    }

    public static Task getInstance(){
        return InstanceKeeper.instance;
    }
}

